/* $Id: JGameMapPropertiesPanelUnitTest.java 63 2010-02-14 13:52:34Z aaron.day $ */
package org.crazydays.gameplan.map.swing;


import org.junit.*;
import static org.junit.Assert.*;

import org.crazydays.gameplan.map.GameMap;

/**
 * JGameMapPropertiesPanelUnitTest
 */
public class JGameMapPropertiesPanelUnitTest
{
    /**
     * Test constructor.
     */
    @Test
    public void testConstructor()
    {
        // test
        JGameMapPropertiesPanel component = new JGameMapPropertiesPanel();

        // verify
        assertNotNull("gameMap", component.gameMap);
    }

    /**
     * Test constructor.
     */
    @Test
    public void testConstructor_one()
    {
        // objects
        GameMap gameMap = new GameMap("ex");

        // test
        JGameMapPropertiesPanel component =
            new JGameMapPropertiesPanel(gameMap);

        // verify
        assertEquals("gameMap", gameMap, component.gameMap);
    }

    /**
     * Test initialize().
     */
    @Test
    public void testInitialize()
    {
        // setup
        JGameMapPropertiesPanel component = new JGameMapPropertiesPanel();

        // test
        component.initialize();

        // verify
        assertEquals("name", "New Map", component.nameInput.getText());
        assertEquals("height", 600, component.heightInput.getValue());
        assertEquals("width", 800, component.widthInput.getValue());
        assertEquals("type", 0, component.gridTypeInput.getSelectedIndex());
    }
}
